import styles from './index.less';
import { Input, Button, Tag, DatePicker, Popover } from 'antd';
import {useState} from 'react';
import TaskDetail from '../TaskDetail';
interface TaskProps{
    title:string,
    desc:string,
    startTime:string,
    endTime:string,
    status:'doing'|'done',
    tag:string
}
export default function TaskItem(props:TaskProps) {
    const {title,desc,startTime,endTime,status,tag} = props
    const [visible,setVisible] = useState<boolean>(false)
    const handleClose = ()=>{
        console.log(111)
        setVisible(false)
    }
  return (
     <>
    <div className={styles.task_item} onClick={()=>{setVisible(true)}}>
        <div className={styles.task_item_info}>
            <div className={styles.task_item_title}>
                {title}
            </div>
            <div className={styles.task_item_desc}>
                {desc}
            </div>
        </div>
        <div className={styles.task_item_status}>
            <div className={styles.task_item_time}>{endTime}</div>
            <Button className={styles.task_item_btn} type="default" href='http://www.baidu.com'>
                    完成
            </Button>
        </div>
    </div>
    <div>
        <TaskDetail handleClose={handleClose} visible={visible} data={props} timeTag={tag}/>
    </div>
    </> 
  );
}